package com.rentplant.utils;


import lombok.Data;

@Data
public class RequestUtils<T> {

    // 数据
    private String msg;
    private T data;

    public RequestUtils() {
    }

    public RequestUtils(T data) {
        this.data = data;
    }

    public static RequestUtils success() {
        RequestUtils RequestUtils = new RequestUtils<>();
        RequestUtils.setMsg("成功");
        return RequestUtils;
    }

    public static <T> RequestUtils<T> success(T data) {
        RequestUtils<T> RequestUtils = new RequestUtils<>(data);
        RequestUtils.setMsg("成功");
        return RequestUtils;
    }

    public static RequestUtils error(String msg) {
        RequestUtils RequestUtils = new RequestUtils<>();
        RequestUtils.setMsg(msg);
        return RequestUtils;
    }
}
